package domain;

/**
 * @author cpp
 * @version 1.0
 * @date 2025/3/18 16:48
 * @description
 */

public class Rectangle {
    //属性
    private double length;
    private double kuan;


    //无参构造
    public Rectangle() {
    }

    //有参构造

    public Rectangle(double length, double kuan) {
        this.length = length;
        this.kuan = kuan;
    }

    public double getLength() {
        return length;
    }

    public void setLength(double length) {
        this.length = length;
    }

    public double getKuan() {
        return kuan;
    }

    public void setKuan(double kuan) {
        this.kuan = kuan;
    }

    //行为
    public double getArea() {
        return length * kuan;
    }

    //周长
    public double getPerimeter() {
        return (length + kuan) * 2;
    }

    public String getInfo() {
        return "长：" + length + "," + "宽:" + kuan + "," + "面积：" + getArea() + "," + "周长：" + getPerimeter();
    }

}
